package com.awangyh.jdk8.map;

import com.awangyh.jdk8.file.NetValueItem;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: wangyanhui
 * @since: 2017/5/2
 */
public class ToArrayDemo {

    public static void main(String ...strings) {
        List<NetValueItem> list = new ArrayList<NetValueItem>();
        NetValueItem item = new NetValueItem();
        item.setShortFilename("11254");
        item.setCode("1");
        list.add(item);

        item = new NetValueItem();
        item.setShortFilename("2222");
        item.setCode("2");
        list.add(item);

        item = new NetValueItem();
        item.setShortFilename("3333");
        item.setCode("3");
        list.add(item);

        String[] paramList = list.stream().parallel().map(it -> it.getShortFilename()).toArray(String[]::new);
        for ( int i =0; i < paramList.length; i ++ ) {
            System.out.println(paramList[i]);
        }

    }
}
